package com.csii.activiti.server.core.utils;

import com.csii.activiti.server.core.constant.FlowFormContentSettingConstant;
import com.csii.activiti.server.core.entity.ActFlowFormContentSetting;

import java.util.List;
import java.util.Map;

public class FormDataPermissionUtils {

    public static void processFormDataPermission(Map<String,Object> formData, List<ActFlowFormContentSetting> permissionList){
        if (permissionList != null && permissionList.size() > 0 && formData != null && !formData.isEmpty()){
            for (ActFlowFormContentSetting actFlowFormContentSetting : permissionList) {
                if (FlowFormContentSettingConstant.HIDE.equals(actFlowFormContentSetting.getSetting())){
                    formData.remove(actFlowFormContentSetting.getFormContentKey());
                }
            }
        }
    }
}
